//
//  LXLoginStyleViewCell.m
//  LvXi_newVersion
//
//  Created by 诸葛孔明 on 16/9/5.
//  Copyright © 2016年 SJT. All rights reserved.
//............................................................................................//
//...........................................个人中心-登录方式cell...........................................//
//............................................................................................//

#import "LXLoginStyleViewCell.h"

@interface LXLoginStyleViewCell ()

@end

@implementation LXLoginStyleViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
    
        UILabel *nameLabel = [[UILabel alloc] init];
        nameLabel.font = [UIFont systemFontOfSize:14];
        nameLabel.textAlignment = NSTextAlignmentLeft;
        [self addSubview:nameLabel];
        self.nameLabel = nameLabel;
        
        UILabel *statusLabel = [[UILabel alloc] init];
        statusLabel.font = [UIFont systemFontOfSize:14];
        statusLabel.textAlignment = NSTextAlignmentRight;
        statusLabel.textColor = [UIColor lightGrayColor];
        self.statusLabel = statusLabel;
//        if (self.status == LXLoginStatus_binding) {
//            statusLabel.textColor = LXMainColor;
//            statusLabel.text = @"绿稀全球购";
//        }else if (self.status == LXLoginStatus_unbinding){
//            statusLabel.textColor = [UIColor lightGrayColor];
//            statusLabel.text = @"未绑定";
//        }
        
        [self addSubview:statusLabel];
        
        
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    self.nameLabel.width = [self.nameLabel.text sizeInAre:MaxSize font:self.nameLabel.font].width;
    self.nameLabel.height = [self.nameLabel.text sizeInAre:MaxSize font:self.nameLabel.font].height;
    self.nameLabel.x = 2*globalMargin;
    self.nameLabel.y = (self.height - self.nameLabel.height) * 0.5;
    
    self.statusLabel.width = [self.statusLabel.text sizeInAre:MaxSize font:self.statusLabel.font].width;
    self.statusLabel.height = [self.statusLabel.text sizeInAre:MaxSize font:self.statusLabel.font].height;
    self.statusLabel.y = self.nameLabel.y;
    self.statusLabel.x = self.width - self.statusLabel.width - 2*globalMargin;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

}

- (void)setFrame:(CGRect)frame
{
    [super setFrame:frame];
}

@end
